package com.xiyu.service.vo.devops.customer.baseVO;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import jakarta.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static com.xiyu.service.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import java.time.LocalDateTime;

/**
 * 客户 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class DevopsCustomerBase {

    @Schema(description = "客户名称")
    @Size(max = 50, message = "项目名称长度不能超过50")
    private String customerName;

    @Schema(description = "客户编号")
    @Size(max = 50, message = "客户编号长度不能超过50")
    private String customerNo;

    @Schema(description = "数据库名称")
    @Size(max = 50, message = "数据库名称长度不能超过50")
    private String databaseName;

    @Schema(description = "项目版本ID")
    private Long versionId;

    @Schema(description = "服务器ID")
    private Long serverId;

    @Schema(description = "是否本地化部署")
    private Boolean isLocal;

    @Schema(description = "同时在线人数")
    @Range(max = 100000000, message = "同时在线人数最大不能超过100000000")
    private Integer onlineAccountCount;

    @Schema(description = "到期时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime expiresTime;

}
